<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Class template indexed_range</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="Chapter 1. Boost.Histogram">
<link rel="up" href="../../histogram/reference.html#header.boost.histogram.indexed_hpp" title="Header &lt;boost/histogram/indexed.hpp&gt;">
<link rel="prev" href="indexed_idm11966.html" title="Function template indexed">
<link rel="next" href="indexed_range/accessor.html" title="Class accessor">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="indexed_idm11966.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../histogram/reference.html#header.boost.histogram.indexed_hpp"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="indexed_range/accessor.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.histogram.indexed_range"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class template indexed_range</span></h2>
<p>boost::histogram::indexed_range — Input iterator range over histogram bins with multi-dimensional index. </p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../histogram/reference.html#header.boost.histogram.indexed_hpp" title="Header &lt;boost/histogram/indexed.hpp&gt;">boost/histogram/indexed.hpp</a>&gt;

</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Histogram<span class="special">&gt;</span> 
<span class="keyword">class</span> <a class="link" href="indexed_range.html" title="Class template indexed_range">indexed_range</a> <span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>
  <span class="comment">// types</span>
  <span class="keyword">typedef</span> <span class="emphasis"><em><span class="identifier">unspecified</span></em></span> <a name="boost.histogram.indexed_range.iterator"></a><span class="identifier">iterator</span><span class="special">;</span>       
  <span class="keyword">typedef</span> <span class="emphasis"><em><span class="identifier">unspecified</span></em></span> <a name="boost.histogram.indexed_range.value_iterator"></a><span class="identifier">value_iterator</span><span class="special">;</span> 
  <span class="keyword">typedef</span> <span class="emphasis"><em><span class="identifier">unspecified</span></em></span> <a name="boost.histogram.indexed_range.value_reference"></a><span class="identifier">value_reference</span><span class="special">;</span>
  <span class="keyword">typedef</span> <span class="emphasis"><em><span class="identifier">unspecified</span></em></span> <a name="boost.histogram.indexed_range.value_type"></a><span class="identifier">value_type</span><span class="special">;</span>     

  <span class="comment">// member classes/structs/unions</span>

  <span class="comment">// Lightweight view to access value and index of current cell.</span>

  <span class="keyword">class</span> <a class="link" href="indexed_range/accessor.html" title="Class accessor">accessor</a> <span class="special">{</span>
  <span class="keyword">public</span><span class="special">:</span>
    <span class="comment">// member classes/structs/unions</span>

    <span class="comment">// Array-like view into the current multi-dimensional index.</span>

    <span class="keyword">class</span> <a class="link" href="indexed_range/accessor/index_view.html" title="Class index_view">index_view</a> <span class="special">{</span>
    <span class="keyword">public</span><span class="special">:</span>
      <span class="comment">// types</span>
      <span class="keyword">typedef</span> <span class="emphasis"><em><span class="identifier">unspecified</span></em></span>              <a class="link" href="indexed_range/accessor/index_view.html#boost.histogram.indexed_range.accessor.index_view.const_iterator"><span class="identifier">const_iterator</span></a><span class="special">;</span> 
      <span class="keyword">typedef</span> <span class="keyword">const</span> <span class="identifier">axis</span><span class="special">::</span><span class="identifier">index_type</span> <span class="special">&amp;</span> <a class="link" href="indexed_range/accessor/index_view.html#boost.histogram.indexed_range.accessor.index_view.const_reference"><span class="identifier">const_reference</span></a><span class="special">;</span>

      <span class="comment">// <a class="link" href="indexed_range/accessor/index_view.html#idm12007-bb">public member functions</a></span>
      <a class="link" href="indexed_range/accessor/index_view.html#boost.histogram.indexed_range.accessor.index_view.const_iterator">const_iterator</a> <a class="link" href="indexed_range/accessor/index_view.html#idm12008-bb"><span class="identifier">begin</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
      <a class="link" href="indexed_range/accessor/index_view.html#boost.histogram.indexed_range.accessor.index_view.const_iterator">const_iterator</a> <a class="link" href="indexed_range/accessor/index_view.html#idm12011-bb"><span class="identifier">end</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
      <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a class="link" href="indexed_range/accessor/index_view.html#idm12014-bb"><span class="identifier">size</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
      <span class="identifier">const_reference</span> <a class="link" href="indexed_range/accessor/index_view.html#idm12016-bb"><span class="keyword">operator</span><span class="special">[</span><span class="special">]</span></a><span class="special">(</span><span class="keyword">unsigned</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
      <span class="identifier">const_reference</span> <a class="link" href="indexed_range/accessor/index_view.html#idm12020-bb"><span class="identifier">at</span></a><span class="special">(</span><span class="keyword">unsigned</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
    <span class="special">}</span><span class="special">;</span>
    <span class="comment">// <a class="link" href="indexed_range/accessor.html#boost.histogram.indexed_range.accessorconstruct-copy-destruct">construct/copy/destruct</a></span>
    <a class="link" href="indexed_range/accessor.html#idm12158-bb"><span class="identifier">accessor</span></a><span class="special">(</span><a class="link" href="indexed_range.html#boost.histogram.indexed_range.iterator">iterator</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
    <a class="link" href="indexed_range/accessor.html#idm12162-bb"><span class="identifier">accessor</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="indexed_range/accessor.html" title="Class accessor">accessor</a> <span class="special">&amp;</span><span class="special">)</span> <span class="special">=</span> <span class="keyword">default</span><span class="special">;</span>
    <a class="link" href="indexed_range/accessor.html" title="Class accessor">accessor</a> <span class="special">&amp;</span> <a class="link" href="indexed_range/accessor.html#idm12145-bb"><span class="keyword">operator</span><span class="special">=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="indexed_range/accessor.html" title="Class accessor">accessor</a> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
    <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span> <a class="link" href="indexed_range/accessor.html" title="Class accessor">accessor</a> <span class="special">&amp;</span> <a class="link" href="indexed_range/accessor.html#idm12151-bb"><span class="keyword">operator</span><span class="special">=</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">T</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>

    <span class="comment">// <a class="link" href="indexed_range/accessor.html#idm12024-bb">public member functions</a></span>
    <span class="identifier">value_reference</span> <a class="link" href="indexed_range/accessor.html#idm12025-bb"><span class="identifier">get</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
    <span class="identifier">value_reference</span> <a class="link" href="indexed_range/accessor.html#idm12028-bb"><span class="keyword">operator</span> <span class="special">*</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
    <span class="identifier">value_iterator</span> <a class="link" href="indexed_range/accessor.html#idm12031-bb"><span class="keyword">operator</span><span class="special">-&gt;</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
    <span class="identifier">axis</span><span class="special">::</span><span class="identifier">index_type</span> <a class="link" href="indexed_range/accessor.html#idm12034-bb"><span class="identifier">index</span></a><span class="special">(</span><span class="keyword">unsigned</span> <span class="special">=</span> <span class="number">0</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
    <a class="link" href="indexed_range/accessor/index_view.html" title="Class index_view">index_view</a> <a class="link" href="indexed_range/accessor.html#idm12044-bb"><span class="identifier">indices</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
    <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">unsigned</span> N <span class="special">=</span> <span class="number">0</span><span class="special">&gt;</span> 
      <span class="keyword">decltype</span><span class="special">(</span><span class="keyword">auto</span><span class="special">)</span> <a class="link" href="indexed_range/accessor.html#idm12048-bb"><span class="identifier">bin</span></a><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">integral_constant</span><span class="special">&lt;</span> <span class="keyword">unsigned</span><span class="special">,</span> <span class="identifier">N</span> <span class="special">&gt;</span> <span class="special">=</span> <span class="special">{</span><span class="special">}</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
    <span class="keyword">decltype</span><span class="special">(</span><span class="keyword">auto</span><span class="special">)</span> <a class="link" href="indexed_range/accessor.html#idm12062-bb"><span class="identifier">bin</span></a><span class="special">(</span><span class="keyword">unsigned</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
    <span class="keyword">double</span> <a class="link" href="indexed_range/accessor.html#idm12071-bb"><span class="identifier">density</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
    <span class="keyword">bool</span> <a class="link" href="indexed_range/accessor.html#idm12077-bb"><span class="keyword">operator</span><span class="special">&lt;</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="indexed_range/accessor.html" title="Class accessor">accessor</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
    <span class="keyword">bool</span> <a class="link" href="indexed_range/accessor.html#idm12082-bb"><span class="keyword">operator</span><span class="special">&gt;</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="indexed_range/accessor.html" title="Class accessor">accessor</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
    <span class="keyword">bool</span> <a class="link" href="indexed_range/accessor.html#idm12087-bb"><span class="keyword">operator</span><span class="special">==</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="indexed_range/accessor.html" title="Class accessor">accessor</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
    <span class="keyword">bool</span> <a class="link" href="indexed_range/accessor.html#idm12092-bb"><span class="keyword">operator</span><span class="special">!=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="indexed_range/accessor.html" title="Class accessor">accessor</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
    <span class="keyword">bool</span> <a class="link" href="indexed_range/accessor.html#idm12097-bb"><span class="keyword">operator</span><span class="special">&lt;=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="indexed_range/accessor.html" title="Class accessor">accessor</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
    <span class="keyword">bool</span> <a class="link" href="indexed_range/accessor.html#idm12102-bb"><span class="keyword">operator</span><span class="special">&gt;=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="indexed_range/accessor.html" title="Class accessor">accessor</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
    <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> U<span class="special">&gt;</span> <span class="keyword">bool</span> <a class="link" href="indexed_range/accessor.html#idm12107-bb"><span class="keyword">operator</span><span class="special">&lt;</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">U</span> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
    <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> U<span class="special">&gt;</span> <span class="keyword">bool</span> <a class="link" href="indexed_range/accessor.html#idm12113-bb"><span class="keyword">operator</span><span class="special">&gt;</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">U</span> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
    <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> U<span class="special">&gt;</span> <span class="keyword">bool</span> <a class="link" href="indexed_range/accessor.html#idm12119-bb"><span class="keyword">operator</span><span class="special">==</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">U</span> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
    <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> U<span class="special">&gt;</span> <span class="keyword">bool</span> <a class="link" href="indexed_range/accessor.html#idm12125-bb"><span class="keyword">operator</span><span class="special">!=</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">U</span> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
    <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> U<span class="special">&gt;</span> <span class="keyword">bool</span> <a class="link" href="indexed_range/accessor.html#idm12131-bb"><span class="keyword">operator</span><span class="special">&lt;=</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">U</span> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
    <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> U<span class="special">&gt;</span> <span class="keyword">bool</span> <a class="link" href="indexed_range/accessor.html#idm12137-bb"><span class="keyword">operator</span><span class="special">&gt;=</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">U</span> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
    <a class="link" href="indexed_range/accessor.html#idm12143-bb"><span class="keyword">operator</span> <span class="identifier">value_type</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <span class="special">}</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="indexed_range.html#boost.histogram.indexed_rangeconstruct-copy-destruct">construct/copy/destruct</a></span>
  <a class="link" href="indexed_range.html#idm12185-bb"><span class="identifier">indexed_range</span></a><span class="special">(</span><span class="identifier">histogram_type</span> <span class="special">&amp;</span><span class="special">,</span> <span class="identifier">coverage</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Iterable<span class="special">&gt;</span> <a class="link" href="indexed_range.html#idm12190-bb"><span class="identifier">indexed_range</span></a><span class="special">(</span><span class="identifier">histogram_type</span> <span class="special">&amp;</span><span class="special">,</span> <span class="identifier">Iterable</span> <span class="special">&amp;&amp;</span><span class="special">)</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="indexed_range.html#idm12178-bb">public member functions</a></span>
  <a class="link" href="indexed_range.html#boost.histogram.indexed_range.iterator">iterator</a> <a class="link" href="indexed_range.html#idm12179-bb"><span class="identifier">begin</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <a class="link" href="indexed_range.html#boost.histogram.indexed_range.iterator">iterator</a> <a class="link" href="indexed_range.html#idm12182-bb"><span class="identifier">end</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idm14875"></a><h2>Description</h2>
<p>The iterator returned by begin() can only be incremented. If several copies of the input iterators exist, the other copies become invalid if one of them is incremented. </p>
<div class="refsect2">
<a name="idm14878"></a><h3>
<a name="boost.histogram.indexed_rangeconstruct-copy-destruct"></a><code class="computeroutput">indexed_range</code> 
        public
       construct/copy/destruct</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem"><pre class="literallayout"><a name="idm12185-bb"></a><span class="identifier">indexed_range</span><span class="special">(</span><span class="identifier">histogram_type</span> <span class="special">&amp;</span> hist<span class="special">,</span> <span class="identifier">coverage</span> cov<span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Iterable<span class="special">&gt;</span> 
  <a name="idm12190-bb"></a><span class="identifier">indexed_range</span><span class="special">(</span><span class="identifier">histogram_type</span> <span class="special">&amp;</span> hist<span class="special">,</span> <span class="identifier">Iterable</span> <span class="special">&amp;&amp;</span> range<span class="special">)</span><span class="special">;</span></pre></li>
</ol></div>
</div>
<div class="refsect2">
<a name="idm14912"></a><h3>
<a name="idm12178-bb"></a><code class="computeroutput">indexed_range</code> public member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem"><pre class="literallayout"><a class="link" href="indexed_range.html#boost.histogram.indexed_range.iterator">iterator</a> <a name="idm12179-bb"></a><span class="identifier">begin</span><span class="special">(</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><a class="link" href="indexed_range.html#boost.histogram.indexed_range.iterator">iterator</a> <a name="idm12182-bb"></a><span class="identifier">end</span><span class="special">(</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre></li>
</ol></div>
</div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Hans
      Dembinski<p>
        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
      </p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="indexed_idm11966.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../histogram/reference.html#header.boost.histogram.indexed_hpp"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="indexed_range/accessor.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
